package chapter6;

import java.util.Arrays;

import manager.*;


/**
 * Exercise 8: (4) Following the form of the example Lunch.java, create a class
 * called ConnectionManager that manages a fixed array of Connection objects.
 * The client programmer must not be able to explicitly create Connection
 * objects, but can only get them via a static method in ConnectionManager. When
 * the ConnectionManager runs out of objects, it returns a null reference. Test
 * the classes in main( ).
 * 
 */

public class Exercise8 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ConnectionManager.initialize(10);
				
		System.out.println(ConnectionManager.myToString());
		for (int  i = 0; i < 11; i++) {
			ConnectionManager.getConnection();
		}

	}

}
